R/general-Probability Function.R

#' Probability Generator
#'
#' Converts a given value into a value in the region (0,1).
#' Uses the exponential cdf. This function is defined
#' separately so that it can be easily changed if needed.
#'
#' @param x some non-negative value
#' @return a value on the range (0,1)
#' @export
probGen <- nimble::nimbleFunction(
  run = function(x = double(0)) {
    returnType(double(0))
    return(1 - exp(-x))
  }
)
GBarnsley/MScProject documentation built on Dec. 26, 2020, 4:03 p.m.